<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 徐永岳
  Date: 2023/4/3
  Time: 23:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>Title</title>
</head>
<body>
<a href="/add.jsp">add a book</a>
<table border="1">
  <tr>
    <th>ID</th>
    <th>TITLE</th>
    <th>AUTHOR</th>
    <th colspan="3">OPTIONS</th>
  </tr>
  <tr>
    <c:forEach var="book" items="${sessionScope.books}">
    <td>${book.id}</td>
    <td>${book.title}</td>
    <td>${book.author}</td>
    <td><a href="/book/removeById/${book.id}">remove</a> </td>
    <td><a href="/book/queryById/${book.id}">edit</a> </td>
    <td><a href="/book/detailsById/${book.id}">details</a> </td>

  </tr>
  </c:forEach>

</table>
</body>
</html>